Conveying state data through state transitions and number of stays in states

ABSTRACT

A method comprises performing at least one zero-bit scan across an interface link. The at least one zero-bit scan defines a command window. The method further comprises an interface adapter counting a number of inert scans in the command window, and the number of inert scans defines a particular command or data. An inert scan results in no data being moved into or out of the interface adapter.

This application is a divisional of prior application Ser. No.12/292,703, filed Dec. 2, 2005, currently pending;

Which incorporates by reference and claims priority from ProvisionalApplication No. 60/632,640, filed Dec. 2, 2004.

BACKGROUND

As electronic circuits and devices have become more complex, testing ofthese devices has become increasingly difficult. Test standards havebeen developed to address at least some of these testing difficulties.One such standard, written by the Joint Test Action Group (“JTAG”), isIEEE standard number 1149.1, which describes the Standard Test AccessPort and Boundary-Scan Architecture. Boundary scan is a methodology thatallows controllability and observability of the boundary pins in a JTAGcompatible device via software control. This capability allows testingof circuit boards that otherwise might not be practical or possiblegiven the trace pitch and multi-layering of printed circuit boardstoday. Testing is accomplished through a series of registers, accessiblethrough a serial bus, which allow the pins of JTAG compatible devices tobe temporarily isolated from their respective devices. The pin on oneisolated JTAG compatible device may be set to a known test state whilethe pin on another isolated JTAG compatible device is monitored toconfirm that it is in the same known state. In this way individualtraces on a printed circuit board may be tested. This type of testinghas generally represented the limits of the testing capabilities of theJTAG architecture.

SUMMARY

The present disclosure describes a system and method for testing atarget system.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of the preferred embodiments of theinvention, reference will now be made to the accompanying drawings inwhich:

FIG. 1 illustrates the signals of a link between a debug test system anda target system of a cJTAG capable system in accordance with at leastsome preferred embodiments;

FIG. 2A illustrates star and series configurations that are possiblewithin a

FIG. 2B illustrates series, narrow star and wide star configurationsthat are possible within a cJTAG capable system in accordance with atleast some preferred embodiments;

FIG. 2C illustrates a series and a wide star cJTAG capable systemconfigured, both configured to operate as narrow star configurations inaccordance with at least some preferred embodiments;

FIG. 3 illustrates a block diagram overview of a cJTAG capable system inaccordance with at least some preferred embodiments;

FIG. 4 illustrates the state transition diagram for a TAP state machinewithin a cJTAG capable system in accordance with at least some preferredembodiments;

FIG. 5 illustrates a high-level schematic of a JTAG target system inaccordance with at least some preferred embodiments;

FIG. 6A illustrates a first example of an inert state usable to enterinto an advanced mode of operation in accordance with at least somepreferred embodiments;

FIG. 6B illustrates a second example of an inert state usable to enterinto an advanced mode of operation in accordance with at least somepreferred embodiments;

FIG. 6C illustrates a simplified version of FIGS. 6A and 6B inaccordance with at least some preferred embodiments;

FIG. 7 illustrates the format of an advanced mode command window inaccordance with at least some preferred embodiments;

FIG. 8A illustrates an example of an assignment of various functions tospecific command levels in accordance with at least some preferredembodiments;

FIG. 8B illustrates an example of specific scan counts associated withspecific advanced mode commands in accordance with at least somepreferred embodiments;

FIG. 9 illustrates a simplified state transition diagram showing thetransitions between IEEE mode and standard mode in accordance with atleast some preferred embodiments;

FIGS. 10A and 10B illustrate a state transition diagram for a cJTAGadapter in accordance with at least some preferred embodiments;

FIG. 11 illustrates the format for an optimized scan message inaccordance with at least some preferred embodiments;

FIG. 12 illustrates examples of several different optimized scan messageformats in accordance with at least some preferred embodiments;

FIG. 13 illustrates the timing diagram for an example of an optimizedscan without a scan stall in accordance with at least some preferredembodiments;

FIG. 14 illustrates the timing diagram for an example of an optimizedscan with a scan stall in accordance with at least some preferredembodiments;

FIG. 15A illustrates the timing diagram of a fixed delay between scanmessages in accordance with at least some preferred embodiments;

FIG. 15B illustrates an example of delay control register bit settingsin accordance with at least some preferred embodiments;

FIG. 16A illustrates the timing diagram for a variable delay betweenscan messages in accordance with at least some preferred embodiments;

FIG. 16B illustrates the state transition diagram for extending a delaybetween scan messages in accordance with at least some preferredembodiments;

FIG. 17 illustrates the timing diagram for several escape sequences inaccordance with at least some preferred embodiments;

FIG. 18 illustrates a cJTAG target system implementing a global bypassbit in accordance with at least some preferred embodiments;

FIG. 19 illustrates a method for assigning link IDs within a cJTAGenabled system in accordance with at least some preferred embodiments;

FIG. 20 illustrates an example of a multi-device scan message format inaccordance with at least some preferred embodiments;

FIG. 21 illustrates a circuit used to allow target system isolation forlater link ID assignment in accordance with at least some preferredembodiments;

FIG. 22A illustrates a method implemented in a debug test system forassigning link IDs in accordance with at least some preferredembodiments;

FIG. 22B illustrates a method implemented in a target system forassigning link IDs in accordance with at least some preferredembodiments;

FIG. 23 illustrates an example of a format for a unique cJTAG isolationpattern in accordance with at least some preferred embodiments;

FIG. 24 illustrates an example of a burst background data transfermessage format in accordance with at least some preferred embodiments;

FIG. 25 illustrates an example of a burst background data transfermessage header in accordance with at least some preferred embodiments;

FIG. 26 illustrates an example of a continuous background data transfermessage format in accordance with at least some preferred embodiments;

FIG. 27 illustrates an example of a continuous background data transfermessage payload format in accordance with at least some preferredembodiments;

FIG. 28 illustrates an example of a burst custom data transfer messageformat in accordance with at least some preferred embodiments;

FIG. 29 illustrates an example of a continuous custom data transfermessage format in accordance with at least some preferred embodiments;

FIG. 30 illustrates an example of power down modes;

FIG. 31 is a timing diagram illustrating an affirmative response powerdown;

FIG. 32 illustrates an example of non-response power down.

NOTATION AND NOMENCLATURE

Certain terms are used throughout the following discussion and claims torefer to particular system components. This document does not intend todistinguish between components that differ in name but not function.

In the following discussion and in the claims, the terms “including” and“comprising” are used in an open-ended fashion, and thus should beinterpreted to mean “including but not limited to . . . ” Also, the term“couple” or “couples” is intended to mean either an indirect or directelectrical connection. Thus, if a first device couples to a seconddevice, that connection may be through a direct electrical connection,or through an indirect electrical connection via other devices andconnections. Additionally, the term “system” refers to a collection oftwo or more parts and may be used to refer to a computer system or aportion of a computer system. Further, the term “software” includes anyexecutable code capable of running on a processor, regardless of themedia used to store the software. Thus, code stored in non-volatilememory, and sometimes referred to as “embedded firmware,” is includedwithin the definition of software.

DETAILED DESCRIPTION

The following discussion is directed to various embodiments of theinvention. Although one or more of these embodiments may be preferred,the embodiments disclosed should not be interpreted, or otherwise used,as limiting the scope of the disclosure, including the claims, unlessotherwise specified. The discussion of any embodiment is meant only tobe illustrative of that embodiment, and not intended to intimate thatthe scope of the disclosure, including the claims, is limited to thatembodiment. “Compact JTAG (cJTAG)”, revision 0.9, dated Nov. 20, 2005 isincorporated herein by reference.

Similarly, “Compact JTAG (cJTAG)”, revision 0.9, which provides adetailed specification for the compact JTAG (“cJTAG”) architecture, isalso meant to describe an illustrative embodiment and is not intended tolimit the present disclosure to the cJTAG architecture described.

The IEEE 1149.1 standard (also known as the JTAG architecture) wasoriginally developed for board-level interconnect testing (sometimesreferred to as “boundary testing”). Standard JTAG implementations do notpermit debug and testing of the individual JTAG compatible componentsthat are mounted on a printed circuit board. Such component test anddebug can be accomplished, however, through extensions and variations ofthe JTAG architecture, in accordance with at least some preferredembodiments, while still keeping the debug and test system (“DTS”) thatcontrols the test sequence, as well as the target system (“TS”)comprising the components that are being tested, compatible with theunderlying JTAG architecture and communication protocol.

FIG. 1 illustrates a system 1000 constructed in accordance with at leastsome preferred embodiments, comprising a debug test system (“DTS”) 1100and a target system (“TS”) 1200, coupled to each other by link 1300. Thedebug test system 1100 may comprise a DTS cJTAG adapter 1110, a DTS IEEE1149.1 bus (“DTS bus”) 1120, and non-IEEE data and control signals 1140.The term “cJTAG” refers to “compact JTAG,” which is an extension of theJTAG standard that uses fewer communications signals, as will bedescribed below. The DTS cJTAG adapter 1110 provides the logic necessaryto convert the standard JTAG signals present on DTS bus 1120 into thesignals and message formats defined for cJTAG operation. The DTS bus1120 couples to a DTS test access port (“TAP”) controller (not shown),which provides the standard JTAG functionality of the debug test system1100. The non-IEEE data and control signals 1140 couple to other logicwithin the debug test system that provides extended functionality beyondthat provided by the DTS TAP controller.

Similarly, the target system (“TS”) 1200 may comprise a TS cJTAG adapter1210, a TS IEEE 1149.1 bus (“TS bus”) 1220, and non-IEEE data andcontrol signals 1240. The TS cJTAG adapter provides the logic necessaryto convert the standard JTAG signals present on TS bus 1220 into thesignals and message formats defined for cJTAG operation. The TS bus 1220couples to a TS test access port (“TAP”; not shown), which provides thestandard JTAG functionality of the target system 1200. The non-IEEE dataand control signals 1240 couple to other logic within the target systemthat provides extended functionality beyond that provided by the TS TAP.

Debug test system 1100 is capable of sending test and debug sequencesvia link 1300 to target system 1200. These sequences allow debug testsystem 1100 to configure target system 1200 for a test, execute thetest, and read back the results of the test. The debug test system 1100may be configured to couple to the target system 1120 using a four orfive wire implementation of link 1300 as defined under the JTAGarchitecture. The link 1300 includes signals TCK (clock), TMSC (modeselect), TDI (data in), TDO (data out), and optionally RTCK (returnclock). As shown, at least the TCK, TMSC, TDI and TDO signals can beused when the debug test system 1100 communicates with the target system1210 according to the JTAG protocol. In this mode of operation, thesignals from the DTS IEEE 1149.1 bus 1120 and the TS IEEE 1149.1 bus(“TS bus”) 1220 are passed by DTS cJTAG adapter 1110 and TS cJTAGadapter 1210 without modification across link 1300.

The system 1000 also incorporates a variation of the JTAG architecturethat provides an alternative physical interface that is designed toreduce the pin count of the interface between the debug test system 1100and the target system 1200. This alternative configuration of the link1300 allows the debug test system 1110 to communicate with the targetsystem 1210 using only the TCK and TMSC signals of link 1300. In thismode of operation the TDI and TDO data are serialized together with theTMSC data and sent across the TMSC signal of link 1300 as a multi-bitserial message packet. Each packet may be either a control packet thatis used to configure a component within the system 1000, or a datapacket used to transfer data from one component to another. Although theTMSC signal is used for transferring the serial packet data in thepreferred embodiment of FIG. 1, other signals (e.g., TDI and TDO) may beused and the present disclosure is intended to encompass all suchembodiments.

FIG. 2A illustrates the two basic interconnect configurations for bothJTAG and cJTAG systems. In the Star configuration, each target systemmay be accessed directly by the debug test system, while in the Seriesconfiguration the debug test system can only send data to, or receivedata from, a target system through any and all intervening targetsystems. FIG. 2B illustrates how each of the two physical interfacesdescribed above may used to couple a debug test system to one or moretarget systems. The Series configuration is allowed under both the JTAGarchitecture and permits mixing JTAG and cJTAG target systems. TheNarrow Star and Wide Star configurations are only valid within the cJTAGarchitecture. The Narrow Star configuration includes the use, in atleast one preferred embodiment, of only the TCK and TMSC signals. Bothsignals are shared by all of the target systems. cJTAG target systemsthat have a wide physical interface, and which are coupled to each otherin either a Series or Wide Star configuration, may optionally operate asif configured to operate in a Narrow Star mode, as shown in FIG. 2C.

It should be noted that throughout this disclosure a distinction is madebetween the TMS bit that is defined in the IEEE standard and the TMSCsignal of the link 1300. When operating the system according to thestandard JTAG protocol, the TMS bit is the only bit transmitted usingthe TMSC signal. But when the system is operating according to the cJTAGprotocol, the TMS bit is just one of several bits that may betransferred across the link 1300 using the TMSC signal. Thus, todifferentiate between the two, the bit is referred to as the TMS bit,while the signal of the link is referred to as the TMSC signal.

Referring again to FIG. 1, both DTS cJTAG adapter 1110 and TS cJTAGadapter 1210 appear to continue to operate according to the standardfour or five wire JTAG protocol when viewed from either the DTS bus 1120or the TS bus 1220. The cJTAG adapters 1110 and 1210, together with link1300, thus provide an abstraction layer or bridge that hides theunderlying 2-wire cJTAG physical interface. This bridge can operateaccording to the JTAG protocol (“IEEE mode”), or can alternativelyoperate according to the cJTAG protocol (“advanced mode”) in a mannerthat is transparent to DTS bus 1120, TS bus 1220 and other portions ofthe debug test system and target systems that operate exclusively inIEEE mode. When operating in advanced mode, data and control informationmay be exchanged with the DTS cJTAG adapter 1110 via either DTS bus 1120or non-IEEE data and control signals 1140. Likewise, data and controlinformation may be exchanged with TS cJTAG adapter 1210 via either TSbus 1220 or non-IEEE data and control signals 1240 when operating inadvanced mode.

FIG. 3 provides an alternative illustration of the system 1000 thatincludes DTS IEEE 1149.1 TAP controller (“DTS TAP controller”) 1130 andTS IEEE 1149.1 TAP (“TS TAP”) 1230. DTS TAP controller 1130 couples toDTS cJTAG adapter 1110 via DTS bus 1120, and TS TAP 1230 couples to TScJTAG adapter 1210 via TS bus 1220. The system 1000 of FIG. 3 can selectbetween IEEE mode and advanced mode in one of at least two ways. First,the operational mode of the system 1000 can be selected when the systemis first powered up. Upon initial power-up, the system 1000 asserts apower-on-reset signal that sets all components within the system to aknown default state. The cJTAG adapters 1110 and 1210 both initiallydefault to IEEE mode. In the preferred embodiment of FIG. 1, the TMS bitis held at a zero state while the TDO bit is sequenced through a patternthat causes the cJTAG adapters, which monitor the TDO bit, to transitioninto advanced mode.

FIG. 4 shows the state transition diagram implemented by the statemachine of TS TAP 1230 in accordance with IEEE standard number 1149.1.Sixteen states are shown and transitions from one state to another areeffectuated by transitions of the TMS bit. As can be seen in FIG. 4,holding the TMS bit to a binary zero causes the TS TAP 1230 totransition from the Test-Logic-Reset state to the Run-Test/ldle state,where it stays as long as the TMS bit is held to a logical zero. Thepreferred binary pattern for the TMS bit that is used to trigger theadvanced mode is “011111101111110111111.” When the TS cJTAG adapter 1210detects this particular predetermined sequence of TMS bit values, the TScJTAG adapter 1210 begins operating in the advanced mode. This patternfor the TMS will cause the state machine of the TS TAP 1230 totransition through the states of the state machine without passingthrough either the shift_DR or shift_IR states. By avoiding thesestates, data is not moved in or out of any of the standard JTAG data orinstruction registers, which freezes the JTAG configuration of thetarget system 1200. Thus, activating advance mode operation of the TScJTAG adapter 1210 has no effect on the TS TAP 1230.

The second way in which the system 1000 of FIG. 3 can select betweenIEEE mode and advanced mode is through the use of “inert” JTAG datascans after the system is past power-on reset and is operational. Inertdata scans are JTAG data scans that do not do anything useful and thusare not normally used. Normally a JTAG data scan includes a fixed seriesof operations designed to accomplish a useful function, such as readingor loading a JTAG data register within the target system 1200. FIG. 5illustrates at least some of the data registers within the target system1200 that are accessible by the TS TAP 1230, in accordance with at leastsome preferred embodiments. These include the ID register 5010, thebypass register 5020, and a collection of input cell, output cell andenable cell registers 5110 through 5150. To load a register, forexample, the register scan operation type (data or instruction) is firstselected, and the current contents of the destination register (e.g.,the bypass register) are then moved to the output shift register ofregister output multiplexer 5050 though a capture operation. Next, aseries of shift operations are performed wherein new data is shiftedinto the input shift register of register input demultiplexer 5040 fromthe TDI input 5210 and old data is simultaneously shifted out the TDOoutput 5220. Finally, an update operation is performed to transfer thenew data from the input shift register of register input demultiplexer5040 to the actual register to which the data is destined.

FIGS. 6A and 6B illustrate how inert JTAG data scans may be used totransition through the TAP state transition diagram without actuallyloading a value. As can be seen, all of the operations that wouldnormally take place in, for example, a register scan to load a registertake place, except for the sequence of shift operations. In FIG. 6A, thesequence of states (shown shaded) includes the Capture_DR state, theExit1_DR state, and the Update_DR state. Similarly, in FIG. 6B thesequence of states include the Capture_DR state, the Exit1₁₃ DR state,the Pause_DR state, the Exit2_DR state, and the Update_DR state.

In each of the sequences of FIGS. 6A and 6B, the capture operationcauses the current value of the destination register to be transferredto the output shift register of register output multiplexer 5050, andthe update operation causes the value in the input shift register ofregister input demultiplexer 5040 to be loaded into the destinationregister. But without intervening shifts, all of the registers end upcontaining the same value, which is the value that was already in theinput shift register of register input demultiplexer 5040 and thedestination register. As a result, no data is transferred in or out ofthe target system 1200, and the contents of the destination registerremain unaltered. Because no data bits are shifted in or out of thetarget system 1200, the inert scans are referred to as “zero-bit” scans(“ZBS”). FIG. 6C summarizes the relevant TAP states that together eachdefine an example of a zero-bit scan. Although two examples are shown,many others are possible and all such sequences of states that define azero-bit scan are intended to be within the scope of this disclosure.

Because zero-bit scans do not corrupt the contents of the JTAGregisters, they can be used to cause the DTS and TS cJTAG adapters toenter into the advanced mode of operation. Once in the advanced mode ofoperation, the debug test controller 1100 of FIG. 3 communicatesdirectly through the DTS cJTAG adapter 1110, bypassing the DTS TAPcontroller 1130. Similarly, cJTAG sequences received by the TS cJTAGadapter 1210 after entering the cJTAG mode of operation are not passedonto the TS TAP 1230, but are instead acted upon directly by the TScJTAG adapter 1210. Operation of the DTS and TS cJTAG adapters 1110 and1210 in advanced mode continues until an event that terminates thecurrent sequence of operations and transitions the DTS and TS cJTAGadapters 1110 and 1210 back to IEEE mode. In the preferred embodiment ofFIG. 3, termination of operations within advanced mode is accomplishedby performing an instruction register select operation. By establishingclear entry and exit sequences in and out of advanced mode, a cJTAGcommand window is defined that starts with, for example, one or morezero-bit scans, followed by cJTAG sequences (data register scans areused in the preferred embodiment of FIG. 3), and ending, for example,with an instruction register scan. The structure of such a scan sequenceand the resulting command window are illustrated in FIG. 7.

Because a zero-bit scan is essentially a no operation (no-op) to the DTSTAP controller 1130 and the TS TAP 1230, any number of zero-bit scansmay be executed one after the other. The ability to send any number ofconsecutive zero-bit scans allows multiple tiers of capabilities or“control levels” to be defined. Each control level corresponds to thenumber of consecutive zero-bit scans, and each control level enables adifferent set of capabilities. FIG. 7 illustrates an example of acommand window in which two zero-bit scan sequences open a commandwindow. The two zero-bit scans that are used to open the window are alsoused to designate the control level as control level 2. FIG. 8A shows anexample, in accordance with at least some preferred embodiments, ofdifferent capabilities being allocated to each control level. Theexample shows that control levels 1-5 are allocated to the cJTAGprotocol (with control levels 4 and 5 being reserved). Control level 0represents IEEE mode (JTAG protocol), and control levels 6 and above areuser defined levels available for extended capabilities beyond thosedefined for the cJTAG protocol of the preferred embodiments describedherein. Other extended capabilities and other control levels will becomeapparent to those skilled in the art, and the present disclosure isintended to encompass all such capabilities and control levels.

Because only zero-bit scans (which do not include TDO or TDI) are usedwithin a command window, shift_DR commands cannot be used to specifydata while in a non-IEEE mode control levels (above level 0 in thepreferred embodiments). Instead, consecutive shift_DR commands areperformed within the command window, and the number of shift_DRoperations is counted. This count is saved, and after the command windowis closed, the saved count is used as data to specify the particularadvanced mode command desired, as well as any data for the command ifapplicable. FIG. 8B illustrates an example of counts used to defineadvanced mode commands in this manner. Although the example shown inFIG. 8B uses a 5-bit data width, any number of bits may be encoded inthis manner and the present disclosure is intended to encompass all bitwidths.

As already noted, the preferred embodiment of FIG. 3 is capable ofmultiple modes of operation. FIG. 9 illustrates a simplified scan statediagram 2000 that shows the modes of operation of the state machineimplemented within the DTS and TS cJTAG adapters 1110 and 1210 of thesystem 1000 (FIG. 3), in accordance with at least some preferredembodiments. Two modes are defined: standard (IEEE) mode 2100 andadvanced mode 2200. The system starts up with the state machines of thecJTAG adapters in the power down (“PD”) state 2110 and after powering upin IEEE mode is capable of performing standard (IEEE) JTAG scans withinstandard scan (“SS”) state 2120. The cJTAG adapters can change modes bytransitioning through the configuration change (“CC”) state 2210. Afterentering the advanced mode, basic cJTAG scans may be performed withinadvanced scan (“AS”) state 2220. Other extended operations may be addedto the basic cJTAG scans, and two such extended operational states areshown (background data transfer or “BDX” state 2230, and custom datatransfer or “CDX” state 2240). The cJTAG adapters may be powered downafter the state machines transition through the configuration state 2210and the standard scan state 2120 and back to the power down state 2110.

FIGS. 10A and 10B illustrate a more detailed cJTAG adapter scan statediagram 3000, in accordance with at least some preferred embodiments.Referring to FIG. 10A, the state machines of the TS cJTAG adapter 1220,for example, starts up in the power down (“PD”) state 3110,transitioning to the standard mode idle (“IEEE”) state 3120 aftercompleting a power-on reset. When the TS cJTAG adapter 1220 receives apacket while in standard mode, the state machine transitions to thedispatch (“DISP”) state 3130. If the packet is a standard scan packet,the packet is forwarded to the TS TAP 1230 without modification by theTS cJTAG adapter 1220, and the state machine returns to the standardmode idle state 3120. If the packet is a change packet (i.e., thebeginning of a command window indicating a change from IEEE mode toadvanced mode), the change packet is processed, transitioning throughchange update (“CUPD”) state 3150, wait state 3140 and dispatch state3130, and into the advanced mode idle (“INO”) state 3160.

When a cJTAG adapter receives an incoming packet while in IEEE mode, thestate machine may transition to one of a variety of states depending onthe type of packet received. If the packet is an advanced scan packet,the state machine transitions through at least some of states 3170-3230in a manner that depends on the advanced scan type. These scan types andtheir relationships to the state diagram are described in more detailbelow. If the packet is either a compressed export (CXPORT) packet or anuncompressed export (UXPORT) packet, the state machine transitionsthrough at least some of states 3240-3310 (FIG. 10B). These data exportoperations and their relationships to the state diagram are described inmore detail below. If the packet is a change packet (e.g., the end of acommand window indicating a change from advanced mode back to IEEEmode), the change packet is processed, transitioning again throughchange update state 3150, wait state 3140 and dispatch state 3130, andback to the IEEE mode idle state 3120.

As already noted, the 2-wire physical interface provided under the cJTAGarchitecture requires that the data transferred across 4 or more wiresbe sent across the interface in the form of a serialized message packet.Data that would be sent across these wires under the JTAG architectureis instead sent as individual data bits within a cJTAG message packet.An example of such a serialized message packet is shown in FIG. 11. Thepacket shown includes bits representing the TDI, TDO and TMS signals ofthe JTAG interface, as well as additional bits used to implementadditional features such as interlocked communications and delays. Notall operations require all of the bits shown in FIG. 11. To avoidsending bits that are not needed for a particular operation, at leastsome of the preferred embodiments define a plurality of scan types, eachwith different packet contents depending on what bits are to be used. Byvarying the bits included in the packet, different levels ofoptimization are possible.

FIG. 12 illustrates several examples of optimized scans (“OScans”), inaccordance with at least some preferred embodiments. Each of the ( )cansshown provides different combinations of bits, and thus different levelsof optimization. For each Oscan, the chart indicates whether the clockis sourced by the debug test system or the target system, which bits areeliminated when not needed, and what the resulting control and datapackets look like as a result of the optimization. The decision of whento omit a bit and utilize a particular OScan is based upon the JTAGstandard, which specifies which bits are needed for particularoperations defined by the TAG state diagram (FIG. 4).

OScan7 preferably provides no optimization and includes bitsrepresenting all of the signals of the JTAG architecture, plus a “ready”bit and one or more optional delay bits. This accounts for JTAGimplementations that may not have followed the JTAG architecture asdefined within the IEEE standard by, for example, transferring data onTDO or TDI during operations when the standard specifies that thesesignals are not used. Thus, OScan7 is provided for compatibilitypurposes, and not to result in any actual optimization.

Each of the remaining OScans results in a reduction in the number ofbits transferred. In each case a given bit can be omitted because it isnot needed for a given type of transaction. If, for example, data onlyneeds to be transferred from a target system to the debug test system,there is no need to include the TDI bit which is used to transfer datafrom the debug test system to the target system. Similarly, the TDO bitis not needed for transfers from the debug test system to a targetsystem. Ready bits (described below) are not needed if the target systemis fast enough to keep up with the debug test system at the full TCKclock rate. TMS is not needed for long data transfers

Referring again to FIG. 12, Oscan6 omits the TDI and ready bits fromcontrol packets and the ready bit from data packets. OScan5 omits allbut the TMS bit from control packets and the ready bit from datapackets. OScan4 omits all but the TMS bit from control packets and omitsthe TDO and ready bits from data packets. OScan3 omits the TDI bit fromcontrol packets and the TMS bit from data packets. OScan2 omits the TDIand ready bits from control packets and the TMS and ready bits from datapackets. OScan1 omits all but the TMS bit from control packets and omitsthe TMS and ready bits from the data packets. OScan0 omits all but theTMS bit from control packets and all but the TDI bit from data packets.The delay bits are optional for all of these packets. Although some ofthe formats described may be capable of one bit per data packet, twobits per data packet is a preferred configuration, as it permitsmaintaining a 2-to-1 ratio between cJTAG link clock and the JTAG clockon the IEEE busses (see FIG. 1). This permits the link to continue tooperate at relatively high clock rates even when the debug test system,the target system, or both are slower, legacy systems.

The OScans of the preferred embodiments also provide additionalcapabilities beyond the base JTAG architecture through the use of aready bit. Because the data transferred between the debug test systemand the target system in the cJTAG architecture is a serialized versionof the signals defined in the JTAG architecture, it may be desirable toclock the serialized data at a higher clock rate to offset the effect ofthe serialization. But some legacy debug test systems that use anexternal cJTAG adapters may not be fast enough to keep up with thehigher clocking rates of the cJTAG architecture. The ready bit providesa means for holding off or “stalling” the target system and keeping itfrom outputting the TDO bit until the debug test system is ready. Asshown in FIG. 13, if the ready bit is set, the next bit sent is the TDObit from the target system. FIG. 14 illustrates the case where thetarget still stalls the debug test system. The ready bit is cleared, andthe next bit sent is a repeat of the ready bit rather than the TDO bit.The ready bit continues to be repeatedly sent until the ready bit iscleared, at which point the TDO bit is sent from the target system tothe debug test system.

The operation of the ready bit is also shown in the scan statetransition diagram of FIG. 10A. When a scan packet that includes a readybit is received in advanced mode the state machine of a cJTAG adapterreceiving the packet can transition from advanced mode idle state(“IN0”) 3160, where it process the first packet bit, to eitherinput/output processing state (“IN1”) 3170, where it would process thesecond packet bit if included, or to the OScan ready state (“RDY0”)3180. If there is no second packet bit prior to the ready bit, the statemachine can transition directly from the advanced mode idle state 3160to the OScan ready state 3180. If the ready bit is not set, the statemachine will hold in the 0Scan ready state 3180. Once the ready bit isset, the state machine then transitions to the TDO processing state(“TDO”) 3190.

The OScans of the preferred embodiments may also provide for additionaltransmission delays through the use of delays between packets. Either afixed or variable number of delay cycles may be introduced between theend of one packet and the beginning of another packet. FIG. 15Aillustrates the transmission of a fixed delay. In the example shown, afixed delay of two clock cycles (TCK cycles) is introduced between twoscan packets. In at least some of the preferred embodiments, theduration of the clock cycles is determined by programming two bitswithin a cJTAG delay control register within the cJTAG adapter of thedebug test system. A delay of 0, 1, and 2 clock cycles may be selectedby setting the delay control bits, for example, to the binary values 00,01, and 10 respectively, as shown in the table of FIG. 15B. Each valuecorresponds to the addition of 0, 1, or 2 clock cycles of delay. Thus,in the example show in FIG. 15A, the delay control register was set to abinary value of 10 (decimal 2), resulting in the two additional delayperiods shown.

FIG. 16A illustrates how delays between packets that are of variablelength may also be provided. In at least some of the preferredembodiments, loading a binary value of 11 into the a cJTAG registercontrol registers enables variable delays and configures the delaysbetween packets to be controlled by the state of the TMS bit. Thesequence of events is shown in FIG. 16B, which is a simplified partialstate transition diagram derived from the scan state transition diagramof FIG. 10. After the initial delay state (“DLY”) 3200 is reached, thestate machine of the cJTAG adapter transitions to wait state (“WAIT”)3140. As long as the TMS bit is set, the state machine will remain inwait state 3140. When the TMS bit is cleared, the state machine willtransition to the dispatch state 3130 and the cJTAG adapter will thenresume processing advanced mode scan packets if the TMS bit remainscleared.

In at least some of the preferred embodiments a timeout mechanism isincluded that forces the state machine of FIG. 16B to reset all cJTAGcontrol registers to their power-on reset values and return the cJTAGstate machine to IEEE mode. The criteria for triggering this timeout isbased on a predetermined number of consecutive clock cycles (e.g., 64clock cycles) during which the TMS bit remains a one. If the TMS bitstops transitioning at least one of the cJTAG adapters is presumed tohave stopped operating properly, warranting a reset of the cJTAGinterface. As described above, variable delays are achieved by holdingthe TMS bit to a one. The timeout mechanism thus limits a variable delaycycle to less than the timeout clock count.

To extend the delay times that are possible, at least some of thepreferred embodiments implement a delay extension mechanism, which isalso shown in FIG. 16B. Assuming, for example, a timeout above 64consecutive clock cycles, if the TMS bit is held high for no more than64 clock cycles, thus transitioning the state machine from the waitstate 3140 to the dispatch state 3130 on the 65^(th) clock cycle, theTMS cycle may be set to a one again, sending the state machine back towait state 3140. No timeout will occur and the delay has now beenextended for up to another 64 clock cycles. This extension sequence maybe repeated as many times as necessary.

As already noted, the purpose of the OScans is to provide a way fortransmitting only that data that is needed and omitting bits of datathat are not needed for a particular transaction. For bits like TDI andTDO this means not including the information within the packet. Butunlike the TDI and TDO bits, the TMS bit is used to determine the statetransitions that occur in both the TAP and cJTAG state machines. ForOScans that include the TMS bit, the TMS bit is held low until the endof the transfer, and then set high during the last packet. For OScanswhere the TMS bit is excluded, at least some of the preferredembodiments use an alternative mechanism that signals the end of thetransfer without using the TMS bit.

FIG. 17 illustrates how the TCK and TMS signals are used to create anend-of-transfer escape sequence that is detectable by a cJTAG adapterbut has no effect on a JTAG TAP state machine. In the preferredembodiment of FIG. 17, serialized data is transferred between the debugtest system and the target system using the TMS signal and clockedbetween the systems using the TCK signal. At the end of an OScan thatomits the TMS bit within the packet transferred, the TCK signal is heldhigh by the DTS cJTAG adapter, which keeps any TPA state machine that iscoupled to the TMS and TCK signals from transitioning states. The TMSsignal is then subsequently set to the inverse of its last state by theDTS cJTAG adapter, and then pulsed while the TCK signal continues to beheld high. A TS cJTAG adapter coupled to the TMS and TCK signals countsthe pulses. After the pulsing completes, the TMS signal is returned toits initial value at the start of the escape sequence and the clock isrestarted. One clock cycle later, the escape sequence takes effect.Although the escape sequence of the preferred embodiment described usesthe TMS signal for transferring data, any other non-TCK signal may beused, and the present disclosure is intended to encompass all suchembodiments.

As illustrated in FIG. 17, the escape sequences of the preferredembodiments can be used for purposes other than just an end-of-transferindication. Both a soft reset and a hard reset are shown. Each uses adifferent number of pulses to indicate which function is desired.Further, the hard reset sequence does not require that the clock resume,allowing a full reset of the cJTAG link even after a failure of theclock to resume. Many other functions can be added by adding additionalpulse counts, and the present disclosure is intended to encompass allsuch functions. Within at least some of the preferred embodiments, anyadditional functions would be implemented with a lower pulse count thansoft and hard reset. In this way hard reset always requires the highestpulse count and would be triggered without having to restart the clockand also would be triggered if the TMS signal gets stuck in a continuoustoggle.

As described above, both soft and hard reset escape sequences areimplemented in at least some of the preferred embodiments. A soft resetescape sequence is used to place an offline cJTAG adapter back online.The soft reset escape sequence is ignored unless the cJTAG adapter isoperating in advanced mode and is in a state that allows a soft reset. Asoft reset escape sequence is allowed immediately after a register writewhile in advanced mode, and anytime if the cJTAG adapter has been placedoffline by enabling an unsupported feature. The soft reset places thecJTAG adapter into IEEE mode, deselects the cJTAG adapter, and closesany open command windows, but does all this without re-initializing anyother part of the cJTAG adapter. A hard reset escape sequence providesthe same functionality as a JTAG test reset or a JTAG boundarycompliance enable. A hard reset asynchronously changes the system statein either IEEE mode or advanced mode. A hard reset may be generatedindependent of the cJTAG adapter state. A hard reset is never ignored.

As illustrated in FIG. 12, different OScans are used depending on thesource of the clock signal used for the cJTAG link. OScans 0-3, forexample, are not allowed if the target system sources the clock. This isdue to the fact that the data packets for these OScans do not includethe TMS bit, and thus require the use of an end of transfer escapesequence. In order for the debug test system to signal the end oftransfer, the debug test system must control the clock. In at least someof the preferred embodiments the DTS cJTAG adapter can check a registerwithin the cJTAG adapter to determine the currently configured clocksource. If an OScan is requested that requires that the debug testsystem source the clock, but the target system is configured to sourcethe clock, a compatible

OScan will be used instead (i.e., one of OScans 4-7), regardless of theOScan that is requested.

Another extension to the JTAG architecture added by the cJTAGarchitecture of at least some of the preferred embodiments is theability to select and de-select cJTAG systems without affecting JTAGtarget systems that are also present in the system. A JTAG target systemis de-selected when it is in bypass mode, i.e., when it has executed abypass instruction and all data is being routed through the 1-bit bypassregister of the target system. A cJTAG target system is de-selected whenit is in global bypass mode and the cJTAG adapter halts the clockprovided to the target system TAP. The cJTAG global bypass mode issimilar to the JTAG bypass mode in that it also executes a correspondingglobal bypass instruction (in advanced mode) that results in all databeing routed through the 1-bit global bypass register, as show in FIG.18. But unlike the JTAG bypass mode, global bypass mode also results inall instructions being routed through the 1-bit global bypass register.

Selection of a JTAG target system is accomplished by taking the JTAGtarget system out of bypass mode. Selection of a cJTAG target system isa two-step process that includes a pre-selection of the desired cJTAGtarget systems, followed by activation of the pre-selections 1 clockcycle after entry by the target system TAP into the run-test/idle state(see FIG. 6A). As previously noted, de-selection of a target systemblocks the clock signal to the target system TAP. The TAP, which is leftin the run-test/idle state after de-selection, does not sequence anyfurther after de-selection because it is no longer receiving a clocksignal. By splitting the selection into a pre-selection that blocks theclock, followed by activation of the pre-selections which re-enable theclock, multiple target systems may be pre-selected in sequence, followedby a single activation that triggers all the pre-selects together. Thepre-selects will all go into effect 1 clock cycle after the activation.The effect is to create a global selection of multiple target systemscoupled to a single port of the test data system.

Global selection of multiple target system can be expanded to operateacross multiple ports. In at least some preferred embodiments, the debugtest system may have multiple cJTAG ports that each couple to multipletarget systems. In such preferred embodiments, the ports may be enabledand disabled through a single control register within the debug testsystem. After the target systems of a port are de-selected, the portitself is disabled. Each port is then enabled in sequence, and whileenabled the above described pre-select sequences are performed on one ormore target systems. After pre-selects of the desired target systemshave been performed on one port, but before activation, the port isdisabled as a second port is enabled. The pre-selection process is thenrepeated for target systems coupled to the second port, and then againfor each successive port. Once all ports have been processed and all thedesired target systems on all ports are pre-selected, the ports are allenabled together and all of the target systems are activated at once.The effect is to create a global selection of multiple target systemscoupled to multiple ports of the debug test system.

In at least some of the preferred embodiments, as previously noted, adebug test system may be coupled to one or more target systems in eithera serial or star configuration. In the series configuration shown inFIG. 2B, both JTAG and cJTAG target systems may be present. The commandsused to select a cJTAG target system (pre-selection and activation) areadvanced mode commands and are ignored by JTAG target systems as no-ops.In the star configurations shown in FIG. 2B, by contrast, all of thetarget systems must be cJTAG target systems.

In order to address cJTAG target systems in a star configuration, eachcJTAG target system must have a unique adapter ID that allows it to beaccessed exclusively at a given point in time. To accomplish this, atleast some of the preferred embodiments utilize a 4-bit link identifierwhich is dynamically assigned by the debug test system to each targetsystem. FIG. 19 illustrates how an ID is assigned to each cJTAG targetsystem. The assignment method 7000 begins with either a power-on resetor a reset of the link coupling the debug test system and target systemsto each other (see Wide Star configuration, FIG. 2B), as shown in block7010. In this state each target system defaults to a link ID of 0,blocks link ID assignment by setting its individual scan status to zero,forces the use of Multi-device Scans (“MScans”), and becomesde-selected. If there is only one target system coupled to the debugtest system (block 7020), no ID assignment is necessary and the IDassignment method 7000 is done (block 7060). Operation may begin byselecting the target system with ID zero, and by using MScans (describedbelow) to access the target system.

If there is more than one target system (block 7020) then all of thetarget systems are de-selected (block 7020) and the link IDs of all ofthe target systems are invalidated by setting the scan status of eachtarget system to one (block 7030). In at least some of the preferredembodiments the de-selection and invalidation blocks are implementedwith advanced mode command sequences that use commands such as thoselisted in FIG. 8B. Referring again to FIG. 19A, once de-selection andinvalidation are complete, ID assignment can proceed (block 7050),completing the method 7000 (block 7060).

As already noted the target systems initially are forced to use MScans.FIG. 20 illustrates the basic data format for an MScan message. Thoughvery similar to the previously described OScan7 message format, theMScan has two additional bits, pre-charge bits 0 and 1 (“PC0” and“PC1”). The ready and TDO bits of at least some of the preferredembodiments are driven by the target systems. But in the starconfiguration, with multiple target systems coupled to a single debugtest system, it is possible for multiple target systems to sometimesattempt to output the ready (“RDY”) or TDO bits at the same time,creating a signal conflict on the TMS signal line. To prevent thisconflict, the target systems drive the TMS signal line with the readyand TDO bit information using a pre-charge/discharge signal driveconfiguration, together with bus-keeper latches, when using MScans.

FIG. 21 illustrates the hardware configuration used to prevent busconflicts on the TMS signal line 1320 together with the MScan format.Referring to both FIGS. 20 and 21, the pre-charge one (“PC1”) bit, whichis always a binary one, is output by the DTS TMS driver 1160 and loadedinto keeper latch 1370. A keeper latch is a latch with an output driverthat is significantly weaker than other output drivers coupled to thesame signal as the input and output of the keeper latch 1370. When DTSTMS driver 1160 outputs a signal, it will overcome the drive of thekeeper latch 1370, if they are driving opposite states, and keeper latch1370 will change state accordingly. In the absence of any drive on theTMS signal line 1320 output driver 1160, keeper latch 1370 will maintainor “keep” the latched bit driven on the signal line. During the TDO bitcycle time, if either target system 1 (“TS 1”) or target system 2 (“TS2”) outputs a TDO value of zero, the corresponding pull-down gate (1450or 1550) will drive the TMS signal line 1320 low, causing keeper latch1370 to also change to a zero. If neither target system drives TMSsignal 1320 to a zero, it will remain in the kept state, which is thelogical one driven onto TMS signal 1320 during the PC1 bit cycle. Thissame mechanism is also used with the ready bit, in combination with thepre-charge zero (“PC0”) bit.

By taking advantage of the “wire-OR” configuration of TMS signal 1320and the MScan format, individual target systems may be isolated andsubsequently assigned a unique link ID. FIG. 22A illustrates a debugtest system ID assignment method 7100, in accordance with at least somepreferred embodiments. After sending an advanced mode command sequenceto all coupled target systems to initiate an assignment cycle (block7110), the debug test system begins initiating a series of MScans (block7115) in which one or more of the target systems output bits from aunique isolation pattern. An isolation pattern is a uniqueidentification number associated with each target system. FIG. 23illustrates an example of an isolation pattern, in accordance with atleast some preferred embodiments, comprising a node ID, a part number,an manufacturer's ID, and a zero for the last bit. The part numbercombined with the manufacturer's ID and the last bit (set to zero) is a28-bit identifier that is sometimes referred to as the JTAG ID. The4-bit node ID provides a means for identifying a target system when twotarget systems have the same JTAG ID. Other techniques for generatingunique isolation patterns for each target system will become apparent tothose skilled in the art, and the present disclosure is intended toencompass all such techniques.

The debug test system waits for the MScan comprising the last isolationpattern bit to complete (block 7120) and then checks to see if the lastbit is a zero (block 7130). If it is not a zero then the pre-charge hasnot been pulled down by any of the target systems, all have beenassigned a link ID, and the assignment method 7100 has completed (block7190). If the last bit is a zero then a target system has pulled downthe pre-charge of the last bit, has been isolated, and the debug testsystems assigns a link ID to the isolated target system (block 7140).The debug test system than increments the link ID (block 7150) andchecks to see if the link ID equals or exceeds 16 (block 7160). If so,more than 16 link IDs have been assigned. The debug test system thenchecks to see if it is configured to continue to isolate the additionaltarget systems coupled to the debug test system (block 7170). If morethan 16 target systems are coupled to the debug test system, it maybecome necessary for at least some of the target systems to share linkIDs. If the debug test system is configured to share IDs, the extratarget systems may optionally be isolated as well so that additionalprocessing may be performed later to share link IDs between two or moretarget systems (described below).

FIG. 22B illustrates a target system ID assignment method 7200corresponding to the debug test system assignment method 7100, and inaccordance with at least some preferred embodiments. After an assignmentcycle has been started (block 7210) and MScans are being generated, thetarget system begins outputting each bit of its assigned isolationpattern during the TDO bit period of each MScan. If the target systemdetects a discrepancy between the TDO bit value output by the targetsystem and the binary value present on the TMS signal line (block 7120),the target system will exit (block 7250) and cease participating in thecurrent ID assignment cycle. If the binary value present on the TMSsignal line matches the TDO bit value output by the target system, thetarget system checks to see if the current bit is the last bit of theisolation pattern (block 7230). If the current bit is the last bit, thenthe target system has been isolated and is assigned a link ID (block7135), and the current assignment cycle ends (block 7250). Otherwise thenext bit is output (block 7240) and the process is repeated.

As already noted, it is possible to have more target systems coupled tothe debug test system in a star configuration than can be accommodateddirectly by the bit-width of the assigned link IDs. In this situation atleast some of the preferred embodiments allow for sharing of link IDs.Sharing is accomplished by determining the number of target systemscoupled to the debug test system, and selectively de-selecting sometarget systems while expressly assigning link IDs to the remainingtarget systems, such that the total number of assigned link IDs neverexceeds the maximum number of available link IDs. To accomplish such anexpress ID assignment, a command level is defined for at least some ofthe preferred embodiments wherein the target systems are blocked fromoutputting the TDO bit (e.g., command levels 3, FIG. 8A). During anassignment cycle, the debug test system acts as a surrogate for thetarget system expressly being assigned a link ID, and outputs theisolation pattern of behalf of the target system. By outputting thetarget system's isolation pattern, the desired target system will be thesystem remaining at the end of the ID assignment cycle, expresslyforcing the assignment of the link ID to the desired target system.

As already noted once all the available IDs have been assigned, thedebug test system can detect that there are still additional targetsystems requiring a link ID. By going through additional assignmentcycles, the debug test system can count the number of target systems inexcess of the available link IDs. Further, the isolation patterns forthe “extra” adapters may be saved for future use in resolving the linkID shortage (e.g., by using the sharing scheme described above). In atleast some of the preferred embodiments, a single link ID is used andall of the adapters share that common ID.

The cJTAG adapters of at least some preferred embodiments are alsocapable of supporting non-scan data transfers between the debug testsystem and one or more target systems. These transfer background datatransfers (BDX) take advantage of the time that the target system TAPsspend in one of several BDX-supporting states such as, for example, therun-test/idle, pause_DR, and pause_IR states (see FIG. 4). The transfersubstitutes BDX information in lieu of the scan packet normallyassociated with a target system TAP state. A background data transfermay be initiated by a cJTAG control register write performed after thetarget system TAP has been in the BDX-supporting state for at least twoconsecutive scan packet cycles. Once a background data transfer has beenactivated the target system TAP state is advanced by each backgrounddata transfer. The selected target system transfers data while targetsystems not selected transition through the same states as the targetsystem transferring data, but without actually participating in thetransfer. This keeps the TAP states of the target systems synchronized.The background data transfer is terminated upon exit from the supportingstate. Data may be transferred exclusively in one direction (to thetarget system, or to the debug test system), or alternately in bothdirections (bidirectional transfer). The bandwidth allocation of abidirectional transfer in at least some of the preferred embodiments is50/50, but other allocations are possible and all such allocations areintended to be within the scope of the present disclosure.

Two types of background data transfers, burst and continuous, aredefined for at least some of the preferred embodiments. FIG. 24illustrates the format of a burst background data transfer. As shown,the first burst packet of a newly activated transfer skips the headerand begins with an abbreviated scan packet followed by burst datapackets. Subsequent packets include the header, which is formatteddepending on the scan format in effect prior to activating thebackground data transfer. FIG. 25 illustrates several different headerconfigurations, in accordance with at least some preferred embodiments,as well as the association between the header configurations and thecJTAG scan formats. When scan formats that support the use of scanstalls or delays are in use, the background data transfer will alsosupport such stalls and delays using the same mechanisms as thosedefined for the scan format. Although the burst data packets of thepreferred embodiments are of fixed bit sizes (e.g., 8, 16, 32, or 64bits), other bit widths may be used and the present disclosure isintended to encompass burst packet sizes of all such bit widths.

It should be noted that the TMS bit of the burst background datatransfer header is driven by the debug test system, while the bitsassociated with the ready check, are driven by the target systemparticipating in the transfer. This is done in order to protect againsta disconnect of the TMS signal between the debug test system and thetarget systems. Referring to FIG. 21, if such a disconnect occurs, thelogic “1” driven by the active target system at the end of the readycheck sequence of the BDX header will be maintained by keeper latch1370. As a result, when the debug test system fails to drive the TMS bitto a logic “0,” TMS will be seen as a logical “1,” the target system TAPstate machines of all the target systems will exit the BDX-supportingstate, and the background data transfer will end. Further, because alogical “1” continues to be present on the TMS signal 1320, the targetsystem TAP state machine of all the target systems will eventuallysequence back to the test-resevidle state (see FIG. 4). This will onlyhappen, however, if the target system is sourcing the clock, or if thedebug test system is sourcing the clock and has not also beendisconnected from the target systems.

FIG. 26 illustrates the format of a continuous background data transfer.Unlike burst background data transfers, continuous background datatransfers do not have any header information, and the data is simply atwo-bit payload, although it is intended that the present disclosureencompass any size payload for continuous background data transfers.Continuous background data transfers are ended using the end of transferescape sequence previously described. Because continuous background datatransfers do not use headers, stalls and delays are not supported duringthese transfers. As a result, at least some of the preferred embodimentswill force a selected continuous background data transfer to be executedas a burst background data transfer if the format in effect uponactivation of the background data transfer requires scan stalls. Burstbackground data transfers will also be forced if the target system isthe source of the clock, and also if the scan packets are configuredwith delays between packets.

The cJTAG adapters of at least some preferred embodiments are alsocapable of supporting non-scan data transfers between the debug testsystem and one or more target systems using non-cJTAG hardware andprotocols incorporated into the cJTAG adapters. As shown in FIGS. 28 and29, these custom data transfers (CDX) are similar to background datatransfers, differing only by the inclusion of an extra bit precedingeach of the burst payload packets and the first continuous payloadpacket. This extra bit is always a one and accounts for the case wherethe CDX hardware of neither the debug test system nor of any targetsystem starts to transfer data after activation of the continuous datatransfer. The system recovers in a manner similar to the TMS signaldisconnect case described above for background data transfers. In allother respects continuous data transfers operate in the same manner asbackground data transfers.

The cJTAG architecture has the added capability of configuring parts ofthe cJTAG interface of the target system to be powered-down underselected conditions. FIG. 30 illustrates some of the conditions underwhich such a power-down is allowed by at least some of the preferredembodiments. Four power-down modes are defined and the power-down modeis selected at power-on reset. The four modes include not permitting apower-down when requested (mode 0), permitting a power-down whenrequested if the state machine of the target system cJTAG TAP is in thetest logic reset (“TLR”) state (mode 1), permitting a power-down if thestate machine of the target system cJTAG TAP is in the test logic resetstate and there has been no link clock (TCK) activity for more than 1millisecond (mode 2), and permitting a power-down based only on the lackof a link clock for more than 1 millisecond (mode 3). Although thepreferred embodiment shown in FIG. 30 uses a 1 millisecond inactivityperiod, other inactivity periods are possible and are intended to bewithin the scope of the present disclosure.

Mode 0 and mode 1 operate in an “affirmative response” (“AR”) model.Both modes involve a requested operation while the link clock is up andrunning The request originates from logic external to the TS cJTAGadapter and is referred to as the Power and Reset Controller (“PRC”). Asshown in FIG. 31, the PRC asserts synchronized power-down request 8030when the PRC is in mode 0 or mode 1. After the TS TAP indicates that ithas entered into the test logic reset state (TLR TAP state signal 8040asserted), and indicates that TMS has been asserted (TMS force 8050),the TS cJTAG adapter performs an orderly shutdown of the cJTAG interface(indicated by PD state 8060), halts the JTAG clock 8020, andacknowledges the power-down request (PD_ACK 8070).

Mode 2 and mode 3 operate in a “non-response” (“NR”) model. As shown inFIG. 32, in these modes of operation the PRC generates an event that maygenerate a power-down acknowledge. If a power-down acknowledge isgenerated, the TS cJTAG adapter must negate the power-down acknowledgewithin the inactivity period. In the preferred embodiment of FIG. 32,the TS cJTAG adapter periodically toggles the power-down acknowledge8120 at an interval that is half the duration of the time base 8110. Thetime base has a period that is equal to the inactivity period.Periodically toggling the power-down acknowledge 8120 acts as a “keepalive” heartbeat that prevents the PRC from powering down the TS cJTAGadapter. If the acknowledge does not negate the state of the power-downacknowledge within the inactivity period, the sampled power-downacknowledge 8130 will remain at the same state for a period of timeexceeding the inactivity timeout, and the power down will be allowed.

It is possible that system operation may be changed or corrupted by amake or break in the connection of a debug test system and targetsystem. In accordance with embodiments of the invention, a “firewall” isimplemented to reduce the chance that system operation is changed orcorrupted by a make or break in the connection of a debug test systemand target system in a mix of powered and un-powered configurations.

A firewall between the debug test system and target system interfacesmay be created at power-on resest (POR) or under the direction of thedebug test system. The firewall blocks the TCK signal to the targetsystem TAPs attached to the cJTAG interface which prevents the TAP fromadvancing. The firewall may be raised and lowered within a commandwindow. Command windows were explained previously.

The firewall may easily be removed by standard scan sequences after PORwithout knowing the system state or scan topography. Commands within acommand window change register values controlling the firewall. Changesin the state of the firewall take effect when the system TAP statereaches the IDLE state.

Devices with an enabled firewall are entirely compatible with those thatdo not have an enabled firewall as the firewall merely enables theglobal bypass provided by the Global Bypass bit in addition to disablingthe advance of the system TAPs connected to the cJTAG interface.

The firewall may be removed prior to performing any other action such asobtaining the device ID with the IDCODE instruction created by the TLRTAP state. The sequence used to disable the firewall is treated as ano-operation by standard JTAG devices or cJTAG devices whose PORinterface disables the firewall. This makes both fire walled andnon-firewalled operation entirely compatible with systems using JTAGprotocols.

A debug and test interface where a firelink characteristic is controlledby registers managed by the link. The registers may be on either thehost or target side of the link.

It is possible that the electrical connection between the DTS and the TSbreaks (e.g., cable disconnected). Embodiments of the invention providefor orderly behavior in such situations. The response may depend onwhether the TS or the DTS is supplying the TCK signal. If, for example,the TS is supplying TCK, the TS's TAP transitions to the TLR state andthe adapter then powers down. In the preferred embodiments, the negativeof the TDI (nTDI) signal is used. The nTDI assures TDO value of “1” inshift state generates a TMS of “1”. The control states generate TDOvalue of “1” in non-shift state which also produces a TMS of “1”. Thestate of the TAP transitions to the test logic reset (TLR) state. Whenat the TLR state, the adapter detects two TMS of “1” which then causes ahard reset. At this point, the adapter is back in the IEEE mode with theTAP state at TLR. The hard reset initializes power down mode to defaultPOR value and permits power down if the mode so permits.

In the case in which the DTS is supplying TCK, the preferred behavior isfreeze the adapter state and if power down mode with no TCK is used, thePRC asserts POR after no TCK time limit is exceeded. An absence of TCKprecludes any advancement of the adapter state. The BCE pin, which has apull down connection, goes low which resets all test logic.

In some embodiments, the DTS may desire to determine the cJTAG topology(e.g., star, series). After POR and physical connection to the TS, theDTS automatically determines the port type. The DTS stimulates theinterface first as an IEEE Star interface. If the DTS finds such aninterface, the DTS may determine if it is a CTAP Star interface. If theDTS does not find a Star interface configuration, the DTS stimulates theinterface as an IEEE series interface. If the DTS finds this interfacetype, the DTS may determine whether the interface has only CTAP enableddevices, a mix of CTAP and Legacy devices, or has only Legacy devices.If neither of these interface types is found, the port is stimulated asa cJTAG link. After this stimulation, this interface is either found orthe link is deemed dead.

The above disclosure is meant to be illustrative of the principles andvarious embodiments of the present invention. Numerous variations andmodifications will become apparent to those skilled in the art. It isintended that the disclosure, including the claims, be interpreted toembrace all such variations and modifications.

1. A process of operating an integrated circuit having test circuitrycomprising: A. placing the test circuitry in a test data mode in whichtest data can be shifted through the test circuitry using test accessport states; B. placing the test circuitry in an advanced mode in whichthe test access port states can be changed and no test data can beshifted through the test circuitry; C. effecting, in the advanced mode,a certain test access port state in the test circuitry a number oftimes; D. counting the number; and E. saving the count in the testcircuitry to specify one of an advanced mode command and data for thecommand.
 2. The process of claim 1 in which the effecting a certain testaccess port state includes effecting a test access port state ofShift_DR.
 3. The process of claim 1 in which the effecting a certaintest access port state includes effecting a test access port state ofShift_DR and the counting the number includes counting a number of clockcycles in which the test access port circuitry remains in the Shift_DRstate.
 4. The process of claim 1 in which the test access port statesinclude Capture_DR, Shift_DR, Exit1_DR, Pause_DR, Exit2_DR, andUpdate_DR.